package demo;

public class Test {
    public static void main(String[] args) {
        Student stu = new Student();
        System.out.println(stu.name);
        Person p1 = new Student();
        p1.say();
        System.out.println(p1.name);
        Person p2 = new Teacher();
        p2.say();
        System.out.println(p2.name);

        Teacher t = (Teacher) p1;
        t.teach();
    }
}
